<?php
/**
 * Sakam - framework oriented trough models
 * 
 * @category   	Sakam
 * @package    	Sakam_Data
 * @author		Carlos Gonzalez <zahualli@gmail.com>
 * @copyright  	Copyright (c) 2009-2010 Carlos Gonzalez
 */
class Sakam_Data_Database
{
	/**
	 * Name of databse
	 * @var 	string
	 * @access	protected
	 */
	protected $_name = null;
	
	/**
	 * Tables of database
	 * @var 	array
	 * @access	protected
	 */
	protected $_tables = array();
	
	/**
	 * Data model
	 * @var Sakam_Data_Interface
	 * @access protected
	 */
	protected $_data = null;
	
	/**
	 * Constructor of class
	 * @param	Sakam_Data_Interface	$data
	 * @param	string					$name
	 * @access	public
	 * @return	void
	 */
	public function __construct( Sakam_Data_Interface $data, $name )
	{
		$this->_data = $data;
		$this->_name = $name;
	}
	
	/**
	 * Get name
	 * @access	public
	 * @return 	string
	 */
	public function getName()
	{
		return $this->_name;
	}
	
	/**
	 * Set name
	 * @param	string	$name
	 * @access	public
	 * @return 	string
	 */
	public function setName( $name )
	{
		$this->_name = $name;
	}
	
	/**
	 * Add table to database
	 * @param	Sakam_Data_Table_Interface	Table
	 * @access	public
	 * @return 	void
	 */
	public function addTable( Sakam_Data_Table_Interface $table )
	{
		$this->_tables[] = $table;
	}
	
	/**
	 * Get SQL code
	 * @abstract
	 * @return	string
	 */
	public abstract function getSQL();
	
}